# $Id: PKGBUILD 179041 2013-03-01 20:41:07Z andrea $
# Maintainer: Pierre Schmitz <pierre@archlinux.de>
# Contributor: Alexandre Bique <bique.alexandre@gmail.com>

pkgname=hefur
pkgver=0.4
pkgrel=2
pkgdesc='A standalone and lightweight BitTorrent tracker'
arch=('i686' 'x86_64')
url='http://github.com/abique/hefur'
license=('MIT')
makedepends=('cmake')
depends=('gnutls' 'xz' 'protobuf')
source=("https://github.com/downloads/abique/${pkgname}/${pkgname}-${pkgver}.tar.xz"
        'hefurd.service')
md5sums=('f0461363f38105140a1f119a3b97d818'
         '731d5be04d74a52541450b5127abeff3')

build() {
	cd ${srcdir}/${pkgname}-${pkgver}
	mkdir build
	cd build
	cmake -DCMAKE_INSTALL_PREFIX=/usr ..
	make
}

package() {
	cd ${srcdir}/${pkgname}-${pkgver}/build
	DESTDIR=${pkgdir} make install
	install -D -m644 ${srcdir}/hefurd.service ${pkgdir}/usr/lib/systemd/system/hefurd.service
	install -D -m644 ${srcdir}/${pkgname}-${pkgver}/LICENSE ${pkgdir}/usr/share/licenses/hefur/LICENSE
	install -d -m755 ${pkgdir}/var/lib/hefurd
}
